package com.sau.pixelcart.common.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "mail")
public class EmailProperties {
    //@Value("${email.user}")
    //发件人邮箱
    public String user;

    //@Value("${email.code}")
    //发件人邮箱授权码
    public String code;

    //@Value("${email.host}")
    //发件人邮箱对应的服务器域名,如果是163邮箱:smtp.163.com   qq邮箱: smtp.qq.com
    public String host;

    //@Value("${email.auth}")
    //身份验证开关
    private boolean auth;

    // 必须提供 Getter/Setter
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    // boolean 类型特殊命名规范
    public boolean isAuth() {
        return auth;
    }

    public void setAuth(boolean auth) {
        this.auth = auth;
    }

}
